package com.mokairui.sort;

import lombok.Data;

/**
 * @Description 通过 Comparable 接口提供比较规则
 * @Author Mokairui
 * @Since 2021/10/7
 */
@Data
public class Student implements Comparable<Student> {
    private String username;
    private int age;

    @Override
    public int compareTo(Student o) {
        return this.getAge() - o.getAge();
    }
}
